package me.zhanshi123.lab4.controller;

import me.zhanshi123.lab4.service.IApiService;
import me.zhanshi123.lab4.service.impl.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class ApiController {
    @Autowired
    private IApiService apiService;

    @RequestMapping("/login")
    public String login(@RequestParam(name = "user") String user,
                        @RequestParam(name = "password") String password) {
        return apiService.login(user, password);
    }
}
